package com.good.jzhouse.controller;

import com.good.jzhouse.bean.Properties;
import com.good.jzhouse.dao.HouseDao;
import com.good.jzhouse.dao.PropertiesDao;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/proinfo")
public class ProInfoController {

    @Resource
    PropertiesDao propertiesDao;
    @Resource
    HouseDao houseDao;

    @RequestMapping("/pro1")
    public String pro1(Model model,Integer id){
        model.addAttribute("p",propertiesDao.selectById(id));
        model.addAttribute("houselist",houseDao.findAllNewHouse(id));
        return " properties/pro1";
    }

    @RequestMapping("/proAll")
    @ResponseBody
    public List<Properties> proAll(Integer id){
        return propertiesDao.findAllNotId(id);
    }



}
